<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>房屋租赁系统</title>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/main.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/libs/modernizr.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.validate.min.js"></script>
<style>
.error {
	font-size: 13px;
	color: red;
}
</style>
<script type="text/javascript">
	$().ready(function() {
		// 在键盘按下并释放及提交后验证提交表单
		$("#myform").validate({
			rules : {
				username : {
					required : true,
				},
				password : {
					required : true,
				},
				confirm_password : {
					required : true,
					equalTo : "#password"
				},
				name : {
					required : true,
				},
				idcard : {
					required : true,
					min : 0
				},
				phone : {
					required : true,
					min : 0
				}
			},
			messages : {
				username : {
					required : "用户名不能为空！",
				},
				password : {
					required : "密码不能为空！",
				},
				confirm_password : {
					required : " 确认密码不能为空!",
					equalTo : "两次密码输入不一致"
				},
				name : {
					required : "真实姓名不能为空！",
				},
				idcard : {
					required : "身份证号码为空！",
				},
				phone : {
					required : "联系电话不能为空！",
				}
			}
		});
	})
</script>

</head>
<body>

	<div class="result-title">
		<h1>添加房源</h1>
	</div>
	<div class="result-content">
		<div class="sidebar-title">
			<form action="${pageContext.request.contextPath}/adduser.action"
				method="post" id="myform" name="myform"
				enctype="multipart/form-data">
				<table class="insert-tab" width="100%">
					<tbody>
						<tr>
							<th><i class="require-red">*</i>用户名：</th>
							<td><input class="common-text required"
								value="${user.username}" id="username" name="username" size="50"
								type="text"></td>

						</tr>
						<tr>
							<th><i class="require-red">*</i>密码：</th>
							<td><input class="common-text required"
								value="${user.password}" id="password" name="password" size="50"
								type="password"></td>

						</tr>
						<tr>
							<th><i class="require-red">*</i>确认密码：</th>
							<td><input class="common-text required"
								id="confirm_password" name="confirm_password" size="50"
								type="password"></td>
						</tr>
						<tr>
							<th><i class="require-red">*</i>真实姓名：</th>
							<td><input class="common-text" name="name"
								value="${userlist.name}" id="name" size="50" type="text"></td>
						</tr>
						<tr>
							<th><i class="require-red">*</i>身份证号码：</th>
							<td><input class="common-text" name="idcard"
								value="${userlist.idcard}" id="idcard" size="50" type="text"></td>
						</tr>
						<tr>
							<th><i class="require-red">*</i>联系方式：</th>
							<td><input class="common-text" name="phone"
								value="${userlist.phone}" id="phone" size="50" type="text"></td>
						</tr>
						<tr>
							<th><i class="require-red">*</i>角色：</th>
							<td><select name="type" id="type" class="required">
									<option value="zuke" selected="selected">租客</option>
									<option value="fangdong">房东</option>
									<option value="admin">管理员</option>
							</select></td>
						</tr>
						<tr>
							<th></th>
							<td><input class="btn btn-primary btn6 mr10" value="提交"
								type="submit"> <input class="btn btn6"
								onclick="history.go(-1)" value="返回" type="button"></td>
						</tr>
						<tr>
							<font id="error" color="red">${error}</font>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>